package com.itic.demo.util;



import com.itic.appbase.framework.utils.PropertyGetter;
import com.itic.web.ro.ResResult;



/** 
 * http://sms.webchinese.com.cn 中国网建 
 * @Title: http://www.smschinese.cn/api.shtml
 * @date 2011-3-22
 * @version V1.2  
 */
public class PhoneMessgeUtil {
	
	
    private static String Uid = PropertyGetter.getString("haliluya_123");
	private static String Key = PropertyGetter.getString("asdfylewlasndlfyul12348o371h");
	
	//手机号码，多个号码如13800000000,13800000001,13800000002
	//private static String smsMob = "15201699383";
	
	//短信内容
	//private static String smsText = "验证码：8888";
	
	
	public static ResResult send(String userId,String smsText,String smsMob) {
		
		//须记录一下短信发送记录
		HttpClientUtil client = HttpClientUtil.getInstance();
		
		//UTF发送
		int result = client.sendMsgUtf8(Uid, Key, smsText, smsMob);
		if(result>0){
			System.out.println("UTF8成功发送条数=="+result);
			return ResResult.build(200, "信息发送成功",result);
		}else{
			System.out.println(client.getErrorMsg(result));
			return ResResult.build(1, "信息发送失败",result);
		}
	}
}
